package com.vegetable.modules.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 银联商务代付业务配置类
 * 用于管理银联商务代付业务的相关配置参数
 */
@Data
@Component
@ConfigurationProperties(prefix = "chinaums")
public class ChinaUMSConfig {
    
    /**
     * 系统编号
     */
    private String sysId = "10003";
    
    /**
     * 请求来源标识
     */
    private String msgSrc = "API";
    
    /**
     * 是否生产环境
     */
    private boolean production = false;
    
    /**
     * 测试环境URL配置
     */
    private UrlConfig test = new UrlConfig(
            "https://mobl-test.chinaums.com/uisouterfront/df/singlepayment/process",
            "https://mobl-test.chinaums.com/uisouterfront/df/qrypaymentstatus/process",
            "https://mobl-test.chinaums.com/uisouterfront/df/qrypaymentbalance/process"
    );
    
    /**
     * 生产环境URL配置
     */
    private UrlConfig productionConfig = new UrlConfig(
            "https://managefree.chinaums.com/uisouterfront/df/singlepayment/process",
            "https://managefree.chinaums.com/uisouterfront/df/qrypaymentstatus/process",
            "https://managefree.chinaums.com/uisouterfront/df/qrypaymentbalance/process"
    );
    
    /**
     * 外部平台私钥（需要根据实际情况配置）
     */
    private String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAAbXA7tnnMuWV6WO1bKEKGyKZRFcRCGDW+UfGFZdx0MEm6+fKTNGTsalEFwFPK36YtQFXcN0FciGmQp1wGts4IqLaEzk9az5UcxIfR00JxpNsTYSZb82ZMpj52WF0FHtyj7qE+K3k/FcKCcEHQ3Soa9LL/GQpyVO0yhxeV5tiRfnHoJxxCRHp3jM//VnlCd6koTwPNPFKsf8Vf+dtGA3/BZPFoHvFP0+vfLmEi2TIHO1f1CZDg67TiC/Kkusl0XBiUAXhjAz1SleNQzKHtUVPbVluBtG8ydk8kcLpqDDST6WPnHg5NgHt9qXp0vOLO7ABkQz+dGCXKm+tWXHnRjj1AgMBAAECggEAMm7AjMKwHZgy0aOR+w9jZUInXlai/+hRd2XWwmLdepm4gj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jp1fS9HrWfX/cart1H6Ef/FKT6Td3aCZAwM6kTLWkDepX+2qWW3pnKytrnp1rHFu9XIR+iFlG2hFOg+ppzUKfX3L3A57xDU=";
    
    /**
     * 银商系统公钥（需要根据实际情况配置）
     */
    private String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu13Ykr8Q4ACqnYMfLL5kgV2JsUC7TQEeWR70Zpulqq6JeujD6dCupnYnGhnMmePasgBZT0rIKGvoUEe5tMS1sfYo6dMqaAwcVfe4XOQaPSQs10XDSMB689+ImZmhECEBJkbKs7K+BBJXBOZGkgHBZsd4pn3vlF4E2yPTrfrcn9OEXZAKrUb/jZm6suzHoXSljqtHWwT7OwQoIX+Q/27gYA6PuGpFFmr4Xtc4a/AqIHeCC4TinbgboD8HqfL0ZoC4NG6Xm2KJ9wK66MbS7sYRiK+7pctZkZLxIJ47Ro5Psuxs4owTdtY7b1aHun9GoUT6Wm4mRO0asvBv0XKn05qn9wIDAQAB";
    
    /**
     * URL配置内部类
     */
    @Data
    public static class UrlConfig {
        /**
         * 单笔代付接口URL
         */
        private String singlePaymentUrl;
        
        /**
         * 单笔代付结果查询接口URL
         */
        private String queryPaymentStatusUrl;
        
        /**
         * 可代付余额查询接口URL
         */
        private String queryPaymentBalanceUrl;
        
        public UrlConfig() {}
        
        public UrlConfig(String singlePaymentUrl, String queryPaymentStatusUrl, String queryPaymentBalanceUrl) {
            this.singlePaymentUrl = singlePaymentUrl;
            this.queryPaymentStatusUrl = queryPaymentStatusUrl;
            this.queryPaymentBalanceUrl = queryPaymentBalanceUrl;
        }
    }
}